import { h } from 'vue'
import {callConfirmMethod} from '@/common/layer-com-utils.js'
import viewDetailOrder from './viewDetailOrder.vue'

/**
 * 查看订单详细
 * @param {object} serverData  - 当前需要查看的订单列表详细数据
 */
function layerViewDetailOrder(serverData){
    let confirmMethod=[];
    layer.open({
        title:`订单详细`,
        type:1,
        area:[`580px`,`500px`],
        content:h(viewDetailOrder,{
            serverData,
            callback:(arrayFn)=>confirmMethod=arrayFn
        }), 
        appContext:getApp().$vm.$.appContext,
        shade: true, 
        shadeClose:false,
        btn: [{
            text:`知晓并关闭`, 
            callback: (layerId) =>callConfirmMethod.call(this,confirmMethod[0],layerId)
        }]
    })
}

export default {
    layerViewDetailOrder
}